﻿/*
*author:徐洪昌
*blog:http://cnblogs.com/xusir
*datetime:${Utils.GetDate} ${Utils.GetTime}
*/ 
 /*数据详细*/
var ActionUrl=adminUrl+"${table.TableNameAlias}_";
 jQuery(function()
 {
      jQuery("#btnBack").click(function(){backToList();});//返回列表
	 init();
 });
#foreach($c in $ColumnList)
	#if($c.IsPrimary)
	#set ($primaryKey=$c.ColumnNameAlias)
	#end
#end
function init()
 {
 var id=GetRequest()["id"];
 var param={"${primaryKey}":id};
jQuery.ajax({
	url: ActionUrl+"View"+admExtension,
	data: param,
	type:"post",
	dataType: "json",
        success: function (result) {
            if (result.dataState.status == "SUCCESS") {
#foreach($c in $ColumnList)
	#if(${Utils.ToTitleLower($c.ColumnNameAlias)}=="status")
		jQuery("#lbl${c.ColumnNameAlias}").html(GetEnumText(Enum.SwitchStatus, result.data.${Utils.ToTitleLower($c.ColumnNameAlias)},1));
	#else
      jQuery("#lbl${c.ColumnNameAlias}").html(result.data.${Utils.ToTitleLower($c.ColumnNameAlias)});
    #end 
#end
	}
	else
	{
 commonBO.alertError(result.dataState);
	}
   },
    error: function () {
    jQuery.messager.alert('操作提醒', "操作失败，请查看错误日志或联系管理员！", 'error');
    }
	});
 }
 /*返回列表页*/
 function  backToList()
 {
     location.href="list.jsp";
 }